package com.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.entity.*;
import java.util.*;
import com.service.*;

@RestController
public class IndexController {

    @Autowired
    private ITestService ts;

    @RequestMapping(value = "/getAll",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
    public Map<String,Object> getAll() throws Exception{
        System.out.println("------IndexController-----getAll");
        Map<String,Object> rm = new HashMap();

        List<TestBean> list = ts.selectAll();
        rm.put("list",list);

        return  rm ;
    }

}
